﻿@model QLMB.Models.DUONGBAY
@{
    ViewBag.Title = "EditDuongBay";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<script language = "javascript" type ="text/javascript">
    $(document).ready(function () {
        var thoigianbay = $("#ThoiGianBay").val();
        var giacoban = $("#GiaCoBan").val();
        var kichhoat = $("input[name = 'KichHoat']:checked").val();
        $("#ThoiGianBay").change(function () {
            if ($(this).val() == thoigianbay && $("#GiaCoBan").val() == giacoban && ($("input[name = 'KichHoat']:checked").val() == kichhoat))
                $("input[type=submit]").attr("disabled", "disabled");
            else
                $("input[type=submit]").removeAttr("disabled", "disabled");
        });

        $("#GiaCoBan").change(function () {
            if ($(this).val() == giacoban && $("#ThoiGianBay").val() == thoigianbay && ($("input[name = 'KichHoat']:checked").val() == kichhoat))
                $("input[type=submit]").attr("disabled", "disabled");
            else
                $("input[type=submit]").removeAttr("disabled", "disabled");
        });
        $("input[name = 'KichHoat']").change(function () {
            if ($("input[name = 'KichHoat']:checked").val() == kichhoat && ($("#ThoiGianBay").val() == thoigianbay) && ($("#GiaCoBan").val() == giacoban))
                $("input[type=submit]").attr("disabled", "disabled");
            else
                $("input[type=submit]").removeAttr("disabled", "disabled");
        });

    });
</script>

<h2>EditDuongBay</h2>

@using (Html.BeginForm())
{
<b>Mã đường bay:</b> @Html.Label(Model.MaDuongBay) <Br />
<b>Sân bay đi:</b>@Html.Label(Model.SanBayDi) <b>Sân bay đến:</b> @Html.Label(Model.SanBayDen) <Br />
<b>Hãng khai thác:</b> @Html.Label(Model.HangKhaiThac) <br />
<b>Hành trình:</b> @Html.Label(Model.HanhTrinh)  <b>Loại đường bay: </b> @Html.Label(Model.LoaiDuongBay)<br />
<b>Thời gian bay:</b> @Html.EditorFor(x => x.ThoiGianBay)<br />
    @Html.ValidationMessageFor(x => x.ThoiGianBay)<br />
<b>Giá cơ bản:</b> @Html.EditorFor(x => x.GiaCoBan)<br />
    @Html.ValidationMessageFor(x => x.GiaCoBan)<br />

@Html.RadioButtonFor(x => x.KichHoat, true) <b>Hoạt động</b> <br />
@Html.RadioButtonFor(x => x.KichHoat, false) <b>Ngưng hoạt động </b>   <br />

<input type ="submit" value = "Cập nhật" disabled = "disabled" />
}

